package com.ee.chat.api.controller;

import com.ee.chat.api.service.ITopService;
import com.ee.chat.common.bean.Result;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author Shane
 * @Date 2019/8/1 23:31
 */
@RestController
@RequestMapping("top")
public class TopController {
    private Logger log = LoggerFactory.getLogger(TopController.class);

    @Resource
    ITopService topService;

    /**
     * 获取神豪榜数据
     * @Author Shane
     * @Date 2019/8/2 22:38
     * @param way   方式，0-神豪榜  1-魅力榜  2-神聊榜  3-勤奋榜
     * @param type  类型，0-天  1-周  2-月
     * @return
     */
    @RequestMapping("getUserTop")
    public Result getUserTop(@RequestParam String token, @RequestParam Integer way, Integer type){
        try {
            return topService.getUserTop(token, way, type);
        } catch(Exception e){
            log.error("【查询神豪榜数据错误】", e);
        }
        return Result.returnFailure();
    }
}
